<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
	<meta http-equiv="description" content="ebb365">
	<title>直播栏目管理</title>
	<link rel="stylesheet" type="text/css" href="/admin/css/css.css"></link>
	<LINK title=win2k-cold-1 media=all href="/command/calendar/calendar-brown.css"  type=text/css rel=stylesheet>
	<SCRIPT src="/command/calendar/calendar.js" type=text/javascript></SCRIPT>
	<SCRIPT src="/command/calendar/calendar-en.js" type=text/javascript></SCRIPT>
	<SCRIPT src="/command/calendar/changebg.js" type=text/javascript></SCRIPT>
	<SCRIPT src="/command/calendar/calendar-setup.js" type=text/javascript></SCRIPT>

	<script type='text/javascript' src='/dwr/interface/homeSiteDWRServ.js'></script>
	<script type='text/javascript' src='/dwr/engine.js'></script>
	<script type='text/javascript' src='/dwr/util.js'></script>
	
	<style type="text/css">
	.vb_wid {width:100%; margin: 0 auto; border-top:1px #FDB18D solid; background:#F5F5F5; color:#FE6500; text-indent:20px; line-height:25px; font-size:12px;}
	.fb_search {width:100%; margin:0 auto; margin-top:20px; border:1px #FFCD7F solid;}
	.fb_search h1 {background:#FFEFBB; margin:0px; padding:0px; line-height:28px; text-indent:10px; font-size:14px;}
	.fb_s_a1 {margin:5px; font-size:14px;}
	.fb_s_a2 {font-size:12px; line-height:22px; color:#999; margin-left:5px;}
	.fb_ddd {width:100%; margin:0 auto; margin-top:10px; border-top:3px #FFCC00 solid; background:url(homeSite/directSeed/images/pen.gif) no-repeat 5px 3px; height:40px; text-indent:50px; line-height:40px; color:#464646; font-size:12px;}
	.fb_nr {width:100%; margin:0 auto; margin-top:10px; line-height:22px; font-size:12px; color:#464646}
	.fb_nr span {color:#FF0000;}
	.fb_nr select {color:464646; font-size:12px;}
	.fb_nr Div {margin-top:10px; height:30px;}
	.fb_nr Div input {font-size:12px; line-height:18px;}
	.inputtttt {border:1px #DEA303 solid; height:20px; color:#464646; font-size:12px; background:url(homeSite/directSeed/images/bottom_bg.jpg) repeat-x left top;}
	.lb {background:#FFCD7F; color:#464646; font-weight:bold; text-align:center; height:30px; line-height:30px;}
	.lb1 {border-bottom:1px #000000 dashed; height:28px;}
	.lb1 td {border-bottom:1px #ccc dashed; background:#eefefe}
	.fy1 {width:100%; margin:0 auto; margin-top:8px; background:#F8F8F8; font-size:12px; height:30px; line-height:28px; text-indent:10px;}
	.fy1 span {color:#FF0000; font-weight:bold;}
	.fy1 a {color:#464646; text-decoration:none;}
	.fy1 a:hover {color:#FF0000; text-decoration:underline;}
	</style>

	<style type="text/css">
	<!--
	.STYLE1 {font-size: 12px}
	-->
	</style>

	
	
	<script language="JavaScript">
<!--//	
		function checkSearch(){
			
			return true;
		}

		function topage(){
			var id = document.getElementById('toPageId').value;
			if(id!=''){
				window.location.href = "/admin/directSeedClass.do?action=list&page="+id+"&pageSize=10";
				return true;
			}
				return false;
		}

		
		function selectAll(choice) {
			var chk = document.getElementsByName("checkboxparam");
			for (var i=0;i<chk.length;i++) {
				var e=chk[i];
				if(choice==1){
					e.checked=true;
				}
				if(choice==2){
					e.checked=(e.checked?false:true);
				}
				if(choice==3){
					e.checked=false;
				}
			}
		}

		function checkboxIsSelected(){
		var chk = document.getElementsByName("checkboxparam");
		   for (var i=0;i<chk.length;i++) {
		        var e=chk[i];
		        if(e.checked){
		        	return true;  
		        }
		   }
		   window.alert('至少选择一项!');
		   return false;
		}
		
		function getDirectSeedNameMap(obj){
		    	homeSiteDWRServ.loadDirectSeedNameMapByInputtime(obj.value,getAllDirectSeedNameMap);
	 	}
		function getAllDirectSeedNameMap(data){
				var magazineNameid = document.getElementById("directSeedNameId");
		      	DWRUtil.removeAllOptions(magazineNameid);
		      	DWRUtil.addOptions(magazineNameid, {'-1':'请选择'}); 
		      	DWRUtil.addOptions(magazineNameid, data); 
		}
		function showDirectSeedClass(obj){
			var id = obj.value;
			var curYear = document.getElementById('year').value;
			window.location.href = "/admin/directSeedClass.do?action=show&nameId="+id+"&curYear="+curYear;
		}
		function load(obj){
		    	homeSiteDWRServ.loadDirectSeedNameMapByInputtime(obj,getAllDirectSeedNameMap);
	 	}
		
//-->
</script>
</head>
<body>
	
	<div class="vb_wid">【直播栏目管理】</div>
	<html:form action="/admin/directSeedClass.do?action=search" method="post">
		<div class="fb_search">
		    <h1>
		   		直播栏目搜索　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　
		   		<a href="/admin/directSeedClass.do?action=toAdd">新加直播栏目</a>
		   	</h1>
		   <div class="fb_s_a1">
		     	选择年份：
		     	<html:select property="year" onchange="getDirectSeedNameMap(this);">
		     		<option value="-1">请选择</option>
		     		<option value="2006" <c:if test="${curYear=='2006'}">selected</c:if>>2006</option>
					<option value="2007" <c:if test="${curYear=='2007'}">selected</c:if>>2007</option>
					<option value="2008" <c:if test="${curYear=='2008'}">selected</c:if>>2008</option>
					<option value="2009" <c:if test="${curYear=='2009'}">selected</c:if>>2009</option>
					<option value="2010" <c:if test="${curYear=='2010'}">selected</c:if>>2010</option>
					<option value="2011" <c:if test="${curYear=='2011'}">selected</c:if>>2011</option>
					<option value="2012" <c:if test="${curYear=='2012'}">selected</c:if>>2012</option>
		     	</html:select>
		     	直播名：
		     	<html:select property="directSeedNameId" onchange="showDirectSeedClass(this);">
		     		<option value="-1">请选择</option>
		     		<logic:present name="directSeedNameMap">
		     			<logic:iterate id="map" name="directSeedNameMap">
		     				<option value="${map.key}" <c:if test="${directSeedName.id==map.key}">selected</c:if>>${map.value}</option>
		     			</logic:iterate>
		     		</logic:present>
		     	</html:select><br/>
		     	推荐：
					<html:select property="iftj" value="${mnForm.iftj}">
						<option value="-1"  <c:if test="${mnForm.iftj==''}">selected</c:if>>请选择</option>
						<option value="1"  <c:if test="${mnForm.iftj==1}">selected</c:if>>是</option>
						<option value="0" <c:if test="${mnForm.iftj==0}">selected</c:if>>否</option>
					</html:select>
					&nbsp;&nbsp;&nbsp; 删除：
					<html:select property="shanchu" value="${mnForm.shanchu}">
						<option value="-1"  <c:if test="${mnForm.shanchu==''}">selected</c:if>>请选择</option>
						<option value="1"  <c:if test="${mnForm.shanchu==1}">selected</c:if>>是</option>
						<option value="0"  <c:if test="${mnForm.shanchu==0}">selected</c:if>>否</option>
					</html:select>
					&nbsp; 时间段：
					 <html:text property="beginDate" style="width:80px" onclick="calendar();" value="${mnForm.beginDate}"></html:text>
			  -
			  <html:text property="endDate" style="width:80px" onclick="calendar();" value="${mnForm.endDate}"></html:text>
			  <font color="gray" size="2">(格式：2008-01-05)</font>
		     	<input type="submit" name="Submit8" value="给我搜" />
		  </div>
		</div>
		</html:form>
		
		
		<form action="/admin/directSeedClass.do?action=delete" method="post">
		
			<div class="fb_nr">
			  <table width="100%" border="0" cellspacing="1">
			    <tr class="lb">
			      <td>选择</td>
			      <td>栏目ID</td>
			      <td width="45%">直播名</td>
			      <td width="15%">栏目名</td>
			      <td>推荐</td>
			      <td>删除</td>
			      <td>编辑</td>
			      <td>录入时间</td>
			    </tr>
			    <logic:notEmpty name="directSeedClassList">
				<logic:iterate id="list" name="directSeedClassList">
					<input type="hidden" name="id" value="${list.id}" />
					<tr align="center" class="lb1">
						<td><input type="checkbox" name="checkboxparam" value="${list.id}"></td>
						<td>${list.id}</td>
						<td align="left">
							<c:set var="dsName" value="${list.dsName}" />
							<c:if test="${fn:length(dsName)>10}">${fn:substring(dsName,0,40)}</c:if>
							<c:if test="${fn:length(dsName)<10}">${list.dsName}</c:if>
						</td>

						<td>
							<c:set var="lanmuname" value="${list.lanmuname}" />
										${fn:substring(lanmuname,0,8)}
						</td>

						<td>${list.iftj!=0?'★':'☆'}</td>

						<td>${list.shanchu!=0?'★':'☆'}</td>
												
						<td>
							<a href="/admin/directSeedClass.do?action=toUpdate&id=${list.id}">
								<img src="homeSite/directSeed/images/edititem.gif" border="0" /></a>
						</td>
						
						<td><bean:write name="list" property="inputdate" format="yyyy年MM月dd日"/></td>
					</tr>
				</logic:iterate>
			</logic:notEmpty>
				<tr>
			      <td colspan="9">
				      <input type="button" onclick="selectAll(1);" value="全选" />
				      <input type="button" onclick="selectAll(2);" value="反选" />
				      <input type="button" onclick="selectAll(3);" value="反选" />
				      <input type="submit" value="设置/取消删除" onclick="return checkboxIsSelected();" />
					  <font color="red" size="2">注：&nbsp;★ 为是， ☆ 为否</font>
			      </td>
			    </tr>
			  </table>
			  </form>
			  
			  
			  <logic:notEmpty name="recordNum">
			<form id="searchForm">

				&nbsp;&nbsp;&nbsp;共有
				<span class="red1">${recordNum}</span> 条记录 共
				<span class="red1">${allPage}</span> 页 &nbsp;&nbsp;|&nbsp;&nbsp;
				<%--  首页  --%>
				<html:link action="/admin/directSeedClass.do?action=list">首页</html:link>
				<%--  上一页  --%>
				<html:link
					action="/admin/directSeedClass.do?action=list&curPage=${curPage}&backPage=${backPage}&nextPage=${nextPage}&page=${page}&pageSize=${pageSize}&doit=backPage">上一页</html:link>

				<%--  页码循环 --%>
				<c:forEach begin="${1}" end="${allPage}" var="page"
					varStatus="pageCount">
					<html:link
						action="/admin/directSeedClass.do?action=list&curPage=${curPage}&backPage=${backPage}&nextPage=${nextPage}&page=${pageCount.index}&pageSize=${pageSize}">

						<c:if test="${curPage==page}">
							<font color="red" class="one"><c:out
									value="${pageCount.index}"></c:out> </font>
						</c:if>
						<c:if test="${curPage!=page}">
							<c:out value="${pageCount.index}"></c:out>
						</c:if>

					</html:link>
				</c:forEach>

				<%--  下一页  --%>
				<html:link
					action="/admin/directSeedClass.do?action=list&curPage=${curPage}&backPage=${backPage}&nextPage=${nextPage}&page=${page}&pageSize=${pageSize}&doit=nextPage">下一页</html:link>
				<%--  尾页  --%>
				<html:link
					action="/admin/directSeedClass.do?action=list&page=${allPage}&pageSize=${pageSize}">尾页</html:link>
				到
				<input id="toPageId" name="toPage" type="text" class="input100"
					size="4" maxlength="4" />
				页&nbsp;
				<input type="button" value=" "
					style="background-image: url('homeSite/directSeed/images/ck.gif');border:0px;width:58px;"
					title="查看" onclick="return topage();" />
			</form>
		</logic:notEmpty>
			  
			  
		</div>
		
	</div>
	
			  
<SCRIPT type=text/javascript>
    Calendar.setup({
        inputField     :    "beginDate",  //sendShopTime2 detailForm:sendShopTime  // id of the input field
        ifFormat       :    "%Y-%m-%d",      // format of the input field
        button         :    "beginDate",  // trigger for the calendar (button ID)
        align          :    "beginDate",           // alignment (defaults to "Bl")
        singleClick    :    true
    });
</SCRIPT>


<SCRIPT type=text/javascript>
    Calendar.setup({
        inputField     :    "endDate",  //sendShopTime2 detailForm:sendShopTime  // id of the input field
        ifFormat       :    "%Y-%m-%d",      // format of the input field
        button         :    "endDate",  // trigger for the calendar (button ID)
        align          :    "endDate",           // alignment (defaults to "Bl")
        singleClick    :    true
    });
</SCRIPT>

	<logic:present name="msg">
		<bean:write name="msg" filter="false" />
	</logic:present>

</body>
</html:html>
